import Vue from "vue"
import Vuex from "vuex"
import userStore from "./userStore"
import permissionStore from "./permissionStore"

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    userStore,
    permissionStore,
  },
  // 定义全局getters 方便访问user 模块的roles
  getters: {
    roles: (state) => state.userStore.roles,
    permission_routes: (state) => state.permissionStore.routes,
  },
})
